from rest_framework.permissions import IsAdminUser
from rest_framework.viewsets import ModelViewSet

from apps.goods.models import Brand
from apps.meiduo_admin.serializers.brands import BrandSerializer
from apps.meiduo_admin.utils import UserPageNum


class BrandView(ModelViewSet):
    '''
        品牌表的增删改查
    '''
    # 指定查询集
    queryset = Brand.objects.all()
    # 指定序列化器
    serializer_class = BrandSerializer
    # 指定分页器
    pagination_class = UserPageNum
    # 指定权限
    permission_classes = [IsAdminUser]
